//
//  WCAddrsAndOrdersCell.m
//  CBT
//
//  Created by apple on 2019/7/8.
//  Copyright © 2019 Mr.Zhang. All rights reserved.
//

#import "WCAddrsAndOrdersCell.h"

@implementation WCAddrsAndOrdersCell

+ (instancetype)createTableView:(UITableView *)tableView {
    WCAddrsAndOrdersCell *cell = [tableView dequeueReusableCellWithIdentifier:@"rootCell"];
    cell.selectionStyle  = UITableViewCellSelectionStyleNone;
    cell.backgroundColor = [UIColor colorWithRed:237/255.0 green:237/255.0 blue:237/255.0 alpha:1];

    [cell makeViews];
    
    return cell;
}

- (void)makeViews {
    
    CGFloat width = (SCREEN_WIDTH-30);
    
    UIView *bgview = [[UIView alloc] init];
    bgview.layer.cornerRadius = 5;
    bgview.backgroundColor = [UIColor whiteColor];
    [self.contentView addSubview:bgview];
    [bgview mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(15);
        make.top.mas_equalTo(10);
        make.height.mas_equalTo(48);
        make.width.mas_equalTo(width);
    }];
    
    [bgview addSubview:self.titleImg];
    [self.titleImg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(17);
        make.top.mas_equalTo(13);
        make.width.height.mas_equalTo(22);
    }];
    
    [bgview addSubview:self.coinNameLabel];
    [self.coinNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(56);
        make.top.mas_equalTo(13);
        make.height.mas_equalTo(22);
        make.width.mas_equalTo(width-100);
    }];
    
    [bgview addSubview:self.swallImg];
    [self.swallImg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(-30);
        make.top.mas_equalTo(20);
        make.width.mas_equalTo(5);
        make.height.mas_equalTo(9);
    }];
}

- (UILabel *)coinNameLabel {
    if (!_coinNameLabel) {
        _coinNameLabel = [[UILabel alloc] init];
        _coinNameLabel.textColor = UIColorFromRGB(0x333333);
        _coinNameLabel.font = [UIFont systemFontOfSize:15];
        _coinNameLabel.text = @"我的订单";
    }
    
    return _coinNameLabel;
}

- (UIImageView *)swallImg {
    if (!_swallImg) {
        _swallImg = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"mine_next"]];
    }
    
    return _swallImg;
}

- (UIImageView *)titleImg {
    if (!_titleImg) {
        _titleImg = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"mine_order"]];
    }
    
    return _titleImg;
}


@end
